/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: jse2204 - Ex
 * <p>Powered by webrx On 2022-09-16 14:07:20
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex {
    public static void main(String[] args) {
        String s = "1024242342342342426";
        System.out.println(s);
        StringBuilder sbu = new StringBuilder(s);
        String ss = sbu.reverse().toString().replaceAll("(\\d{3})","$1,");
        System.out.println(new StringBuilder(ss).reverse());

        sbu.reverse();
        for (int i = 0; i < s.length(); i++) {
            if (i % 3 == 0 && i != 0) sbu.insert(s.length() - i, ',');
        }
        System.out.println(sbu);

    }
}
